﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Qenergy.ascx.cs" Inherits="StreetSmartAdmin.Qenergy" %>
<h2>Q Energy Form</h2>     
            <asp:DetailsView ID="DetailsView4" runat="Server" CellPadding="4" ForeColor="#333333"
                        GridLines="None" DataSourceID="SqlDataSource5" AllowPaging="True" AutoGenerateRows="False"
                        DataKeyNames="ID" AutoGenerateInsertButton="True" DefaultMode="Edit" CssClass="mGrid"
                        PagerStyle-CssClass="pgr" AlternatingRowStyle-CssClass="alt" 
                            EnableModelValidation="True" Visible="true">
                        <AlternatingRowStyle CssClass="alt"></AlternatingRowStyle>
                        <Fields>
                        <asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" 
                            ReadOnly="True" SortExpression="ID" />
                        <asp:BoundField DataField="USERID" HeaderText="USERID" 
                            SortExpression="USERID" />
                        <asp:BoundField DataField="LIST_ID" HeaderText="LIST_ID" 
                            SortExpression="LIST_ID" />
                        <asp:BoundField DataField="REF_ID" HeaderText="REF_ID" 
                            SortExpression="REF_ID" />
                        <asp:BoundField DataField="TITLE" HeaderText="TITLE" SortExpression="TITLE" />
                        <asp:BoundField DataField="FIRST_NAME" HeaderText="FIRST_NAME" 
                            SortExpression="FIRST_NAME" />
                        <asp:BoundField DataField="LAST_NAME" HeaderText="LAST_NAME" 
                            SortExpression="LAST_NAME" />
                        <asp:BoundField DataField="DOB" HeaderText="DOB" SortExpression="DOB" />
                        <asp:BoundField DataField="DRIVERS_LICENSE" HeaderText="DRIVERS_LICENSE" 
                            SortExpression="DRIVERS_LICENSE" />
                        <asp:BoundField DataField="COMPANY_NAME" HeaderText="COMPANY_NAME" 
                            SortExpression="COMPANY_NAME" />
                        <asp:BoundField DataField="ABN" HeaderText="ABN" SortExpression="ABN" />
                        <asp:BoundField DataField="PHONE1" HeaderText="PHONE1" 
                            SortExpression="PHONE1" />
                        <asp:BoundField DataField="PHONE2" HeaderText="PHONE2" 
                            SortExpression="PHONE2" />
                        <asp:BoundField DataField="UNIT_NUMBER" HeaderText="UNIT_NUMBER" 
                            SortExpression="UNIT_NUMBER" />
                        <asp:BoundField DataField="STREET_NUMBER" HeaderText="STREET_NUMBER" 
                            SortExpression="STREET_NUMBER" />
                        <asp:BoundField DataField="STREET_NAME" HeaderText="STREET_NAME" 
                            SortExpression="STREET_NAME" />
                        <asp:BoundField DataField="STREET_TYPE" HeaderText="STREET_TYPE" 
                            SortExpression="STREET_TYPE" />
                        <asp:BoundField DataField="SUBURB" HeaderText="SUBURB" 
                            SortExpression="SUBURB" />
                        <asp:BoundField DataField="STATE" HeaderText="STATE" SortExpression="STATE" />
                        <asp:BoundField DataField="POSTCODE" HeaderText="POSTCODE" 
                            SortExpression="POSTCODE" />
                        <asp:BoundField DataField="NMI" HeaderText="NMI" SortExpression="NMI" />
                        <asp:BoundField DataField="EMAIL" HeaderText="EMAIL" SortExpression="EMAIL" />
                        <asp:BoundField DataField="NOTES" HeaderText="NOTES" SortExpression="NOTES" />
                        <asp:BoundField DataField="ASSOCIATION" HeaderText="ASSOCIATION" 
                            SortExpression="ASSOCIATION" />
                        <asp:BoundField DataField="ACCOUNT_MANAGER" HeaderText="ACCOUNT_MANAGER" 
                            SortExpression="ACCOUNT_MANAGER" />
                        <asp:CommandField ShowEditButton="True" />
                    </Fields>
                </asp:DetailsView>

                <asp:SqlDataSource ID="SqlDataSource5" runat="server" 
                    ConflictDetection="CompareAllValues" 
                    ConnectionString="<%$ ConnectionStrings:SQLServer2005DBConnectionString %>" 
                    DeleteCommand="DELETE FROM [QEnergy] WHERE [ID] = @original_ID AND (([USERID] = @original_USERID) OR ([USERID] IS NULL AND @original_USERID IS NULL)) AND (([LIST_ID] = @original_LIST_ID) OR ([LIST_ID] IS NULL AND @original_LIST_ID IS NULL)) AND (([REF_ID] = @original_REF_ID) OR ([REF_ID] IS NULL AND @original_REF_ID IS NULL)) AND (([TITLE] = @original_TITLE) OR ([TITLE] IS NULL AND @original_TITLE IS NULL)) AND (([FIRST_NAME] = @original_FIRST_NAME) OR ([FIRST_NAME] IS NULL AND @original_FIRST_NAME IS NULL)) AND (([LAST_NAME] = @original_LAST_NAME) OR ([LAST_NAME] IS NULL AND @original_LAST_NAME IS NULL)) AND (([DOB] = @original_DOB) OR ([DOB] IS NULL AND @original_DOB IS NULL)) AND (([DRIVERS_LICENSE] = @original_DRIVERS_LICENSE) OR ([DRIVERS_LICENSE] IS NULL AND @original_DRIVERS_LICENSE IS NULL)) AND (([COMPANY_NAME] = @original_COMPANY_NAME) OR ([COMPANY_NAME] IS NULL AND @original_COMPANY_NAME IS NULL)) AND (([ABN] = @original_ABN) OR ([ABN] IS NULL AND @original_ABN IS NULL)) AND (([PHONE1] = @original_PHONE1) OR ([PHONE1] IS NULL AND @original_PHONE1 IS NULL)) AND (([PHONE2] = @original_PHONE2) OR ([PHONE2] IS NULL AND @original_PHONE2 IS NULL)) AND (([UNIT_NUMBER] = @original_UNIT_NUMBER) OR ([UNIT_NUMBER] IS NULL AND @original_UNIT_NUMBER IS NULL)) AND (([STREET_NUMBER] = @original_STREET_NUMBER) OR ([STREET_NUMBER] IS NULL AND @original_STREET_NUMBER IS NULL)) AND (([STREET_NAME] = @original_STREET_NAME) OR ([STREET_NAME] IS NULL AND @original_STREET_NAME IS NULL)) AND (([STREET_TYPE] = @original_STREET_TYPE) OR ([STREET_TYPE] IS NULL AND @original_STREET_TYPE IS NULL)) AND (([SUBURB] = @original_SUBURB) OR ([SUBURB] IS NULL AND @original_SUBURB IS NULL)) AND (([STATE] = @original_STATE) OR ([STATE] IS NULL AND @original_STATE IS NULL)) AND (([POSTCODE] = @original_POSTCODE) OR ([POSTCODE] IS NULL AND @original_POSTCODE IS NULL)) AND (([NMI] = @original_NMI) OR ([NMI] IS NULL AND @original_NMI IS NULL)) AND (([EMAIL] = @original_EMAIL) OR ([EMAIL] IS NULL AND @original_EMAIL IS NULL)) AND (([NOTES] = @original_NOTES) OR ([NOTES] IS NULL AND @original_NOTES IS NULL)) AND (([ASSOCIATION] = @original_ASSOCIATION) OR ([ASSOCIATION] IS NULL AND @original_ASSOCIATION IS NULL)) AND (([ACCOUNT_MANAGER] = @original_ACCOUNT_MANAGER) OR ([ACCOUNT_MANAGER] IS NULL AND @original_ACCOUNT_MANAGER IS NULL))" 
                    InsertCommand="INSERT INTO [QEnergy] ([USERID], [LIST_ID], [REF_ID], [TITLE], [FIRST_NAME], [LAST_NAME], [DOB], [DRIVERS_LICENSE], [COMPANY_NAME], [ABN], [PHONE1], [PHONE2], [UNIT_NUMBER], [STREET_NUMBER], [STREET_NAME], [STREET_TYPE], [SUBURB], [STATE], [POSTCODE], [NMI], [EMAIL], [NOTES], [ASSOCIATION], [ACCOUNT_MANAGER]) VALUES (@USERID, @LIST_ID, @REF_ID, @TITLE, @FIRST_NAME, @LAST_NAME, @DOB, @DRIVERS_LICENSE, @COMPANY_NAME, @ABN, @PHONE1, @PHONE2, @UNIT_NUMBER, @STREET_NUMBER, @STREET_NAME, @STREET_TYPE, @SUBURB, @STATE, @POSTCODE, @NMI, @EMAIL, @NOTES, @ASSOCIATION, @ACCOUNT_MANAGER)" 
                    OldValuesParameterFormatString="original_{0}" 
                    SelectCommand="SELECT * FROM [QEnergy] WHERE ([USERID] = @USERID)" 
                    UpdateCommand="UPDATE [QEnergy] SET [USERID] = @USERID, [LIST_ID] = @LIST_ID, [REF_ID] = @REF_ID, [TITLE] = @TITLE, [FIRST_NAME] = @FIRST_NAME, [LAST_NAME] = @LAST_NAME, [DOB] = @DOB, [DRIVERS_LICENSE] = @DRIVERS_LICENSE, [COMPANY_NAME] = @COMPANY_NAME, [ABN] = @ABN, [PHONE1] = @PHONE1, [PHONE2] = @PHONE2, [UNIT_NUMBER] = @UNIT_NUMBER, [STREET_NUMBER] = @STREET_NUMBER, [STREET_NAME] = @STREET_NAME, [STREET_TYPE] = @STREET_TYPE, [SUBURB] = @SUBURB, [STATE] = @STATE, [POSTCODE] = @POSTCODE, [NMI] = @NMI, [EMAIL] = @EMAIL, [NOTES] = @NOTES, [ASSOCIATION] = @ASSOCIATION, [ACCOUNT_MANAGER] = @ACCOUNT_MANAGER WHERE [ID] = @original_ID AND (([USERID] = @original_USERID) OR ([USERID] IS NULL AND @original_USERID IS NULL)) AND (([LIST_ID] = @original_LIST_ID) OR ([LIST_ID] IS NULL AND @original_LIST_ID IS NULL)) AND (([REF_ID] = @original_REF_ID) OR ([REF_ID] IS NULL AND @original_REF_ID IS NULL)) AND (([TITLE] = @original_TITLE) OR ([TITLE] IS NULL AND @original_TITLE IS NULL)) AND (([FIRST_NAME] = @original_FIRST_NAME) OR ([FIRST_NAME] IS NULL AND @original_FIRST_NAME IS NULL)) AND (([LAST_NAME] = @original_LAST_NAME) OR ([LAST_NAME] IS NULL AND @original_LAST_NAME IS NULL)) AND (([DOB] = @original_DOB) OR ([DOB] IS NULL AND @original_DOB IS NULL)) AND (([DRIVERS_LICENSE] = @original_DRIVERS_LICENSE) OR ([DRIVERS_LICENSE] IS NULL AND @original_DRIVERS_LICENSE IS NULL)) AND (([COMPANY_NAME] = @original_COMPANY_NAME) OR ([COMPANY_NAME] IS NULL AND @original_COMPANY_NAME IS NULL)) AND (([ABN] = @original_ABN) OR ([ABN] IS NULL AND @original_ABN IS NULL)) AND (([PHONE1] = @original_PHONE1) OR ([PHONE1] IS NULL AND @original_PHONE1 IS NULL)) AND (([PHONE2] = @original_PHONE2) OR ([PHONE2] IS NULL AND @original_PHONE2 IS NULL)) AND (([UNIT_NUMBER] = @original_UNIT_NUMBER) OR ([UNIT_NUMBER] IS NULL AND @original_UNIT_NUMBER IS NULL)) AND (([STREET_NUMBER] = @original_STREET_NUMBER) OR ([STREET_NUMBER] IS NULL AND @original_STREET_NUMBER IS NULL)) AND (([STREET_NAME] = @original_STREET_NAME) OR ([STREET_NAME] IS NULL AND @original_STREET_NAME IS NULL)) AND (([STREET_TYPE] = @original_STREET_TYPE) OR ([STREET_TYPE] IS NULL AND @original_STREET_TYPE IS NULL)) AND (([SUBURB] = @original_SUBURB) OR ([SUBURB] IS NULL AND @original_SUBURB IS NULL)) AND (([STATE] = @original_STATE) OR ([STATE] IS NULL AND @original_STATE IS NULL)) AND (([POSTCODE] = @original_POSTCODE) OR ([POSTCODE] IS NULL AND @original_POSTCODE IS NULL)) AND (([NMI] = @original_NMI) OR ([NMI] IS NULL AND @original_NMI IS NULL)) AND (([EMAIL] = @original_EMAIL) OR ([EMAIL] IS NULL AND @original_EMAIL IS NULL)) AND (([NOTES] = @original_NOTES) OR ([NOTES] IS NULL AND @original_NOTES IS NULL)) AND (([ASSOCIATION] = @original_ASSOCIATION) OR ([ASSOCIATION] IS NULL AND @original_ASSOCIATION IS NULL)) AND (([ACCOUNT_MANAGER] = @original_ACCOUNT_MANAGER) OR ([ACCOUNT_MANAGER] IS NULL AND @original_ACCOUNT_MANAGER IS NULL))">
                <DeleteParameters>
                    <asp:Parameter Name="original_ID" Type="Int32" />
                    <asp:Parameter Name="original_USERID" Type="Int32" />
                    <asp:Parameter Name="original_LIST_ID" Type="String" />
                    <asp:Parameter Name="original_REF_ID" Type="String" />
                    <asp:Parameter Name="original_TITLE" Type="String" />
                    <asp:Parameter Name="original_FIRST_NAME" Type="String" />
                    <asp:Parameter Name="original_LAST_NAME" Type="String" />
                    <asp:Parameter Name="original_DOB" Type="String" />
                    <asp:Parameter Name="original_DRIVERS_LICENSE" Type="String" />
                    <asp:Parameter Name="original_COMPANY_NAME" Type="String" />
                    <asp:Parameter Name="original_ABN" Type="String" />
                    <asp:Parameter Name="original_PHONE1" Type="String" />
                    <asp:Parameter Name="original_PHONE2" Type="String" />
                    <asp:Parameter Name="original_UNIT_NUMBER" Type="String" />
                    <asp:Parameter Name="original_STREET_NUMBER" Type="String" />
                    <asp:Parameter Name="original_STREET_NAME" Type="String" />
                    <asp:Parameter Name="original_STREET_TYPE" Type="String" />
                    <asp:Parameter Name="original_SUBURB" Type="String" />
                    <asp:Parameter Name="original_STATE" Type="String" />
                    <asp:Parameter Name="original_POSTCODE" Type="String" />
                    <asp:Parameter Name="original_NMI" Type="String" />
                    <asp:Parameter Name="original_EMAIL" Type="String" />
                    <asp:Parameter Name="original_NOTES" Type="String" />
                    <asp:Parameter Name="original_ASSOCIATION" Type="String" />
                    <asp:Parameter Name="original_ACCOUNT_MANAGER" Type="String" />
                </DeleteParameters>
                <InsertParameters>
                    <asp:Parameter Name="USERID" Type="Int32" />
                    <asp:Parameter Name="LIST_ID" Type="String" />
                    <asp:Parameter Name="REF_ID" Type="String" />
                    <asp:Parameter Name="TITLE" Type="String" />
                    <asp:Parameter Name="FIRST_NAME" Type="String" />
                    <asp:Parameter Name="LAST_NAME" Type="String" />
                    <asp:Parameter Name="DOB" Type="String" />
                    <asp:Parameter Name="DRIVERS_LICENSE" Type="String" />
                    <asp:Parameter Name="COMPANY_NAME" Type="String" />
                    <asp:Parameter Name="ABN" Type="String" />
                    <asp:Parameter Name="PHONE1" Type="String" />
                    <asp:Parameter Name="PHONE2" Type="String" />
                    <asp:Parameter Name="UNIT_NUMBER" Type="String" />
                    <asp:Parameter Name="STREET_NUMBER" Type="String" />
                    <asp:Parameter Name="STREET_NAME" Type="String" />
                    <asp:Parameter Name="STREET_TYPE" Type="String" />
                    <asp:Parameter Name="SUBURB" Type="String" />
                    <asp:Parameter Name="STATE" Type="String" />
                    <asp:Parameter Name="POSTCODE" Type="String" />
                    <asp:Parameter Name="NMI" Type="String" />
                    <asp:Parameter Name="EMAIL" Type="String" />
                    <asp:Parameter Name="NOTES" Type="String" />
                    <asp:Parameter Name="ASSOCIATION" Type="String" />
                    <asp:Parameter Name="ACCOUNT_MANAGER" Type="String" />
                </InsertParameters>
                <SelectParameters>
                    <asp:ControlParameter ControlID="GridView1" Name="USERID" 
                        PropertyName="SelectedValue" Type="Int32" />
                </SelectParameters>
                <UpdateParameters>
                    <asp:Parameter Name="USERID" Type="Int32" />
                    <asp:Parameter Name="LIST_ID" Type="String" />
                    <asp:Parameter Name="REF_ID" Type="String" />
                    <asp:Parameter Name="TITLE" Type="String" />
                    <asp:Parameter Name="FIRST_NAME" Type="String" />
                    <asp:Parameter Name="LAST_NAME" Type="String" />
                    <asp:Parameter Name="DOB" Type="String" />
                    <asp:Parameter Name="DRIVERS_LICENSE" Type="String" />
                    <asp:Parameter Name="COMPANY_NAME" Type="String" />
                    <asp:Parameter Name="ABN" Type="String" />
                    <asp:Parameter Name="PHONE1" Type="String" />
                    <asp:Parameter Name="PHONE2" Type="String" />
                    <asp:Parameter Name="UNIT_NUMBER" Type="String" />
                    <asp:Parameter Name="STREET_NUMBER" Type="String" />
                    <asp:Parameter Name="STREET_NAME" Type="String" />
                    <asp:Parameter Name="STREET_TYPE" Type="String" />
                    <asp:Parameter Name="SUBURB" Type="String" />
                    <asp:Parameter Name="STATE" Type="String" />
                    <asp:Parameter Name="POSTCODE" Type="String" />
                    <asp:Parameter Name="NMI" Type="String" />
                    <asp:Parameter Name="EMAIL" Type="String" />
                    <asp:Parameter Name="NOTES" Type="String" />
                    <asp:Parameter Name="ASSOCIATION" Type="String" />
                    <asp:Parameter Name="ACCOUNT_MANAGER" Type="String" />
                    <asp:Parameter Name="original_ID" Type="Int32" />
                    <asp:Parameter Name="original_USERID" Type="Int32" />
                    <asp:Parameter Name="original_LIST_ID" Type="String" />
                    <asp:Parameter Name="original_REF_ID" Type="String" />
                    <asp:Parameter Name="original_TITLE" Type="String" />
                    <asp:Parameter Name="original_FIRST_NAME" Type="String" />
                    <asp:Parameter Name="original_LAST_NAME" Type="String" />
                    <asp:Parameter Name="original_DOB" Type="String" />
                    <asp:Parameter Name="original_DRIVERS_LICENSE" Type="String" />
                    <asp:Parameter Name="original_COMPANY_NAME" Type="String" />
                    <asp:Parameter Name="original_ABN" Type="String" />
                    <asp:Parameter Name="original_PHONE1" Type="String" />
                    <asp:Parameter Name="original_PHONE2" Type="String" />
                    <asp:Parameter Name="original_UNIT_NUMBER" Type="String" />
                    <asp:Parameter Name="original_STREET_NUMBER" Type="String" />
                    <asp:Parameter Name="original_STREET_NAME" Type="String" />
                    <asp:Parameter Name="original_STREET_TYPE" Type="String" />
                    <asp:Parameter Name="original_SUBURB" Type="String" />
                    <asp:Parameter Name="original_STATE" Type="String" />
                    <asp:Parameter Name="original_POSTCODE" Type="String" />
                    <asp:Parameter Name="original_NMI" Type="String" />
                    <asp:Parameter Name="original_EMAIL" Type="String" />
                    <asp:Parameter Name="original_NOTES" Type="String" />
                    <asp:Parameter Name="original_ASSOCIATION" Type="String" />
                    <asp:Parameter Name="original_ACCOUNT_MANAGER" Type="String" />
                </UpdateParameters>
                </asp:SqlDataSource>